/*
 * A Gneral purpose java based Genome Library created by Susanta Tewari.
 * Copyright is protected. Contact Susanta Tewari at <statsusant@yahoo.com>
 */

package genomemap.tagging.analysis;

import factory.genomemap.FactoryManager;

import genomemap.data.DataSource;
import genomemap.data.Gene;
import genomemap.data.Probe;
import genomemap.tagging.Tagger;

import java.util.ArrayList;
import java.util.Collection;

/**
 *
 * @author Susanta Tewari <stewari@yahoo.com>
 */
public class TaggingAnalysis {

    public static void main(String[] args) {

        Collection<Gene> allGenes   = new ArrayList<>();
        Collection<Probe> allProbes = new ArrayList<>();

        for (int i = 0; i < 7; i++) {

            int ch_id = (i + 1);

            allGenes.addAll(DataSource.getGDataSource(ch_id).getFullGeneSet());
            allProbes.addAll(DataSource.getPDataSource(ch_id).getFullProbeSet());
        }

        Probe[] probes   = allProbes.toArray(new Probe[0]);
        Gene[] genes     = allGenes.toArray(new Gene[0]);
        Tagger seqTagger = new Tagger(genes, probes);

        seqTagger.addTaggingStrategy(
            FactoryManager.getInstance().getTaggingFactory().getSeqTaggingStrategy());
        System.out.println("Running with sequence tagging strategy");
        seqTagger.tag();
        System.out.println("Total genes tagged: " + seqTagger.getTotalGenesTagged());
        System.out.println("Added: Complementation tagging data");

        Tagger complTagger = new Tagger(genes, probes);

        complTagger.addTaggingStrategy(
            FactoryManager.getInstance().getTaggingFactory().getComplementationTaggStrategy());
        complTagger.tag();
        System.out.println("Total genes tagged: " + complTagger.getTotalGenesTagged());
        System.out.println("Added: Hybridization tagging strategy");

        Tagger hybridTagger = new Tagger(genes, probes);

        hybridTagger.addTaggingStrategy(
            FactoryManager.getInstance().getTaggingFactory().getHybridizationTaginStrategy());
        hybridTagger.tag();
        System.out.println("Total genes tagged: " + hybridTagger.getTotalGenesTagged());
    }
}
